package com.fhz.shop.ui.search;

import com.fhz.shop.entity.SearchBean;
import com.fhz.shop.ui.search.datasource.SearchLocalDataSource;
import com.fhz.shop.ui.search.datasource.SearchRemoteDataSource;

import java.util.List;

import javax.inject.Inject;

/**
 * 时间:2023/9/1
 *
 * @author Mr.Feng
 * 简述: TODO
 */
public class SearchRepository {
    @Inject
    SearchLocalDataSource mSearchLocalDataSource;
    @Inject
    SearchRemoteDataSource mSearchRemoteDataSource;

    @Inject
    public SearchRepository(SearchLocalDataSource searchLocalDataSource, SearchRemoteDataSource searchRemoteDataSource) {
        mSearchLocalDataSource = searchLocalDataSource;
        mSearchRemoteDataSource = searchRemoteDataSource;
    }

    public void insert(SearchBean... searchBean){
        mSearchLocalDataSource.insert(searchBean);
    }

    public List<SearchBean> queryAll(){
        return mSearchLocalDataSource.queryAll();
    }

    public void delete(SearchBean searchBean){
        mSearchLocalDataSource.delete(searchBean);
    }
}
